using MicroMsg.Storage;
using MicroMsg.UI.Page;
using MicroMsg.UI.UserContrl;
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
namespace MicroMsg.UI.Converter
{
	public class GroupToForgroundBrushValueConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			object result = null;
			if (value is Group<Contact>)
			{
				Group<Contact> group = value as Group<Contact>;
				if (group != null && group.HasItems)
				{
					SolidColorBrush solidColorBrush = new SolidColorBrush();
					solidColorBrush.set_Color(Color.FromArgb(255, 255, 255, 255));
					result = solidColorBrush;
				}
				else
				{
					SolidColorBrush solidColorBrush2 = new SolidColorBrush();
					solidColorBrush2.set_Color(Color.FromArgb(255, 126, 126, 126));
					result = solidColorBrush2;
				}
			}
			else
			{
				if (value is SelectPhoneContryPage.Group<AreaCode>)
				{
					SelectPhoneContryPage.Group<AreaCode> group2 = value as SelectPhoneContryPage.Group<AreaCode>;
					if (group2 != null && group2.HasItems)
					{
						SolidColorBrush solidColorBrush3 = new SolidColorBrush();
						solidColorBrush3.set_Color(Color.FromArgb(255, 255, 255, 255));
						result = solidColorBrush3;
					}
					else
					{
						SolidColorBrush solidColorBrush4 = new SolidColorBrush();
						solidColorBrush4.set_Color(Color.FromArgb(255, 126, 126, 126));
						result = solidColorBrush4;
					}
				}
				else
				{
					if (value is SelectCountryPage.Group<string>)
					{
						SelectCountryPage.Group<string> group3 = value as SelectCountryPage.Group<string>;
						if (group3 != null && group3.HasItems)
						{
							SolidColorBrush solidColorBrush5 = new SolidColorBrush();
							solidColorBrush5.set_Color(Color.FromArgb(255, 255, 255, 255));
							result = solidColorBrush5;
						}
						else
						{
							SolidColorBrush solidColorBrush6 = new SolidColorBrush();
							solidColorBrush6.set_Color(Color.FromArgb(255, 126, 126, 126));
							result = solidColorBrush6;
						}
					}
					else
					{
						if (value is SelectStatePage.Group<string>)
						{
							SelectStatePage.Group<string> group4 = value as SelectStatePage.Group<string>;
							if (group4 != null && group4.HasItems)
							{
								SolidColorBrush solidColorBrush7 = new SolidColorBrush();
								solidColorBrush7.set_Color(Color.FromArgb(255, 255, 255, 255));
								result = solidColorBrush7;
							}
							else
							{
								SolidColorBrush solidColorBrush8 = new SolidColorBrush();
								solidColorBrush8.set_Color(Color.FromArgb(255, 126, 126, 126));
								result = solidColorBrush8;
							}
						}
					}
				}
			}
			return result;
		}
		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}
